<?php

/**
 * 站内消息
 *
 * Created by PhpStorm.
 * User: evan
 * Date: 16/9/25
 * Time: 下午5:04
 */
class Base extends MY_Api_Controller
{
    /**
     * 用户消息列表
     */
    public function index()
    {
        $uid   = $this->uid;
        $page  = (int)$this->input->get_post('page');
        $limit = (int)$this->input->get_post('limit');


        $this->load->service('message/service_message_base');
        $data = $this->service_message_base->index($uid, $page, $limit);


        $this->json_output($data['data'], $data['status']);
    }


    /**
     * 与某个用户/系统对话
     */
    public function dialogue()
    {
        $uid    = $this->uid;
        $to_uid = (int)$this->input->get_post('to_uid');
        $page   = (int)$this->input->get_post('page');
        $limit  = (int)$this->input->get_post('limit');


        $this->load->service('message/service_message_base');
        $data = $this->service_message_base->dialogue($uid, $to_uid, $page, $limit);


        $this->json_output($data['data'], $data['status']);
    }
}